package com.songcha.library_business.proxy.personal_recommend

import com.songcha.library_business.event.home.PersonalRecommendStateChangeEvent
import com.songcha.library_common.helper.SharedPreferenceHelper
import org.greenrobot.eventbus.EventBus

class PersonalRecommendManager {
    companion object{
        private var isPersonalRecommendEnabled=false

        @JvmStatic
        fun init(){
            isPersonalRecommendEnabled=
                SharedPreferenceHelper.getBoolean("personal_recommend","enabled",true)
        }

        fun setPersonalRecommendEnabled(enabled:Boolean){
            SharedPreferenceHelper.setBoolean("personal_recommend","enabled",enabled)
            isPersonalRecommendEnabled=enabled
            EventBus.getDefault().post(PersonalRecommendStateChangeEvent(enabled))
        }

        fun getPersonalRecommendEnabled():Boolean{
            return isPersonalRecommendEnabled
        }
    }
}